#include<stdio.h>
#include<math.h>

int main()
{
	int n =1;
	float pi=0.0,s =1.0,t=1;
	while(fabs(t)>=1e-6)
	{
		pi = pi+t;
		s =-s;
		n+=2;
		t = s/n;
		
	}
	pi = pi*4;
	printf("pi=%f\n",pi);
	
	return 0;
}
